package com.smbms.controller;

import com.smbms.pojo.Role;
import com.smbms.service.RoleService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/role")
public class RoleController {
    @Resource
    private RoleService roleService;

    @ResponseBody
    @RequestMapping("/getRoleList")
    public Object getRoleList(){
        List<Role> roleList=roleService.getRoleList();

        Map<String,Object> result=new HashMap<>();
        result.put("flag",true);
        result.put("msg","角色列表查询成功");
        result.put("data",roleList);

        return result;
    }
}
